package com.front.web.mall;

import com.bootdo.hotel.service.*;
import com.bootdo.lvyou.service.LvyouCityService;
import com.bootdo.lvyou.service.LvyouScenicSpotService;
import com.bootdo.lvyou.service.LvyouSpecialtyEnclosureService;
import com.bootdo.lvyou.service.XcxConfigService;
import com.bootdo.mall.service.*;
import com.bootdo.member.service.ShequMemberService;
import com.bootdo.redis.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;

public class MallSupperController {
    @Autowired
    protected HotelRoomTypeService hotelRoomTypeService;
    @Autowired
    protected HotelRoomFloorService hotelRoomFloorService;
    @Autowired
    protected HotelRoomService hotelRoomService;
    @Autowired
    protected LvyouScenicSpotService lvyouScenicSpotService;
    @Autowired
    protected HotelRoomDayStatusService hotelRoomDayStatusService;
    @Autowired
    protected HotelOrderService hotelOrderService;
    @Autowired
    protected HotelEveryDayMoneyService hotelEveryDayMoneyService;
    @Autowired
    protected HotelRoomMoneyCodeService hotelRoomMoneyCodeService;
    @Autowired
    protected RedisUtil redisUtil;
    @Autowired
    protected LvyouCityService lvyouCityService;
    @Autowired
    protected HotelMemberService hotelMemberService;
    @Autowired
    protected MallGoodService mallGoodService;
    @Autowired
    protected MallCateGoryService mallCateGoryService;
    @Autowired
    protected MallOrderService mallOrderService;
    @Autowired
    protected MallOrderLogService mallOrderLogService;
    @Autowired
    protected GoodSpecsService goodSpecsService;
    @Autowired
    protected LvyouSpecialtyEnclosureService lvyouSpecialtyEnclosureService;
    @Autowired
    protected XcxConfigService xcxConfigService;
    @Autowired
    protected ShequMemberService shequMemberService;
    @Autowired
    protected MallIndexCategoryService mallIndexCategoryService;
    @Autowired
    protected MallIndexCategoryJoinService mallIndexCategoryJoinService;

    public Double checkDouble(Double d){
        if(null != d){
            BigDecimal bd=new  BigDecimal(d);
            BigDecimal  bd1=bd.setScale(2,bd.ROUND_HALF_UP);
            return bd1.doubleValue();
        }else{
            BigDecimal  bd=new  BigDecimal(0);
            BigDecimal  bd1=bd.setScale(2,bd.ROUND_HALF_UP);
            return bd1.doubleValue();
        }
    }

}
